import { defineStore } from 'pinia'

export const useStore = defineStore('main', {
  state: () => {
    return {
      count: 0,
      status: true,
      testCont: [],
      userInfo: {},
      isShowLoadding: false
    }
  },
  getters: {},
  actions: {}
})
// vue使用
/**
 *  import { storeToRefs } from "pinia";
 *  import { useStore } from '../store/index'
 *   const user = useStore();
 *  const { count, status } = storeToRefs(use)
 * 
 * 使用$path 修改多条状态数据
 *  user.$patch((state)=>{
        {
        state.status = user.count > 10 ? false : true,
        state.count = user.status ? user.count+1:user.count-1
    }
    })

 *  */
